package com.taotao.remote.factory;


import com.taotao.common.core.domain.Result;
import com.taotao.product.domain.SkuInventoryQuantity;
import com.taotao.remote.SkuInfoRemoteService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 日志服务降级处理
 *
 * @author ruoyi
 */
@Component
public class RemoteSkuInfoFallbackFactory implements FallbackFactory<SkuInfoRemoteService>
{

    @Override
    public SkuInfoRemoteService create(Throwable cause) {
        return new SkuInfoRemoteService() {
            @Override
            public Result<Long> selectMerchantIdsBySkuIds(Long skuId) {
                return Result.error();
            }

            @Override
            public Result decrInventory(List<SkuInventoryQuantity> skuInventoryQuantities) {
                return Result.error();
            }
        };
    }
}
